import request from "@/request/request";
export function addShopCart(shopCart){
    return request({
        url: '/shopcart/add',
        method: 'POST',
        data: shopCart
    })
}
export function getShopCarts(userId){
    return request({
        url: '/shopcart/list',
        method: 'GET',
        params: {
            userId: userId
        }
    })
}
//更新购物车数量
export function updateShopCartNum(cartId,cartNum){
    return request({
        url: '/shopcart/update/'+cartId+'/'+cartNum,
        method: 'POST'
    })
}
//批量或单个删除购物车
export function deleteShopCart(selectionList){
    return request({
        url: '/shopcart/delete',
        method: 'DELETE',
        headers: {
            'Content-Type': 'application/json; charset=UTF-8'
        },
        data:selectionList
    })
}